package com.yixing.tech.common.enums.biz;

import java.util.ArrayList;
import java.util.List;

public enum ProcessCodeAndName {
    ID_0("0", "6521092b9b8f1972c0e0f98d","发料"),
    ID_1("1", "64cb54619b8f1972c0e0f8bd","制绒"),
    ID_2("2", "64cb5478f607ea2da1f86fca","硼扩"),
    ID_3("3", "64cb54829b8f1972c0e0f8be","激光SE"),
    ID_4("4", "64cb548df607ea2da1f86fcb","退火"),
    ID_5("5", "64cb54b79b8f1972c0e0f8bf","BSG-碱抛"),
    ID_6("6", "64cb54b79b8f1972c0e0f8bf","BSG-碱抛"),
    ID_7("7", "64cb54c69b8f1972c0e0f8c0","LPCVD"),
    ID_8("8", "64cb54d0f607ea2da1f86fcd","磷扩"),
    ID_9("9", "64cb54e09b8f1972c0e0f8c1","去PSG-RCA"),
    ID_10("10", "64cb54e09b8f1972c0e0f8c1","去PSG-RCA"),
    ID_11("11", "64cb54e7f607ea2da1f86fce","ALD"),
    ID_12("12", "64cb54ee9b8f1972c0e0f8c2","正镀膜"),
    ID_13("13", "64cb54f6f607ea2da1f86fcf","背镀膜"),
    ID_14("14", "64cb54fd9b8f1972c0e0f8c3","丝网印刷"),
    ID_15("15", "64cb5505f607ea2da1f86fd0","测试分选"),
    ID_16("16", "","离线测试"),
    ID_17("17", "","包装");

    private String id;
    private String code;
    private String name;

    ProcessCodeAndName(String id, String code, String name) {
        this.id = id;
        this.code = code;
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getCodeById(String id) {
        for (ProcessCodeAndName process : ProcessCodeAndName.values()) {
            if (process.getId().equals(id)) {
                return process.getCode();
            }
        }
        return null;
    }

    public static List<String> getPidStrListByCode(String code) {
        List<String> pidStrList = new ArrayList<>();
        for (ProcessCodeAndName process : ProcessCodeAndName.values()) {
            if (process.getCode().equals(code)) {
                pidStrList.add(process.getId());
            }
        }
        return pidStrList;
    }
    //返回整形id
    public static List<Integer> getIdListByCode(String code) {
        List<Integer> pidList = new ArrayList<>();
        for (ProcessCodeAndName process : ProcessCodeAndName.values()) {
            if (process.getCode().equals(code)) {
                pidList.add(Integer.valueOf(process.getId()));
            }
        }
        return pidList;
    }
}
